import java.io.*;

/**
 * @Description TODO
 * @Author hhy
 * @Date 2020/10/19 11:25
 */
public class Main {
    public static void main(String[] args) throws IOException {
        FileUtils fileUtils = new FileUtils();
        File file = new File("b.jpg");

        try (FileInputStream fileInputStream = new FileInputStream("a.jpg");
             FileOutputStream fileOutputStream = new FileOutputStream("b.jpg");
        ) {
            if (!file.exists()) file.createNewFile();
            fileUtils.copyFile(fileInputStream, fileOutputStream);

        }

    }

}
